import random

def generate_lottery_numbers():
    return [random.randint(1,33)for _ in range(8)]

def check_prize(user_numbers,winning_numbers):
    correct=sum(1 for a,b in zip(user_numbers,winning_numbers) if a==b)
    if correct==8:
        return "一等奖"
    elif correct==7:
        return "二等奖"
    elif correct==6:
        return "三等奖"
    elif correct==5:
        return "四等奖"
    else:
        return "未中奖"

def simulate_lottery():
    winning_numbers=generate_lottery_numbers()
    print("中奖号码是：",winning_numbers)

    user_input=input("请输入8个数字（1-33），用空格分隔：")
    user_numbers=list(map(int,user_input.split()))

    if len(user_numbers)!=8:
        print("请输入8个数字")
        return

    prize=check_prize(user_numbers,winning_numbers)
    print(f"您获得了:{prize}")

    target_numbers=[1,2,3,4,5,6,7,8]
    wins=0
    for _ in range(10000):
        if check_prize(target_numbers,generate_lottery_numbers())!="未中奖":
            wins +=1
        print(f"10000注彩票中，特定号码的中奖概率是：{wins / 10000:.4f}")

simulate_lottery()